<html><head><title>Roundoff Example</title></head>
<link rel="stylesheet" type="text/css" href="style.css" />  
<script language="JavaScript">
function roundOff(unitvalue, nbrunits, precision){ 
unitvalue =  parseFloat(unitvalue);	 	//convert unitvalue to decimal
nbrunits = parseInt(nbrunits);	 		//convert nbrunits to integer
precision = parseInt(precision);	 	//convert precision to integer
var result= unitvalue * nbrunits;
result = result.toFixed(precision);
return result;  } 
</script>
<body>
<h2>Using the toFixed() function</h2><br />
<script language="JavaScript">
alert(roundOff(323.335443,101,2));
</script>
</body></html>
